package com.zhixi.principle.liskovsubstitutionprinciple.operation;

/**
 * 士兵
 *
 * @作者 ShuHaoNan
 * @邮箱 shuhaonan1@gmail.com
 * @时间 2020/11/14 17:29
 */
public class Soldier {

    /* 枪支 */
    private AbstractGun gun;

    public void setGun(AbstractGun gun) {
        this.gun = gun;
    }

    public void killEnemy() {
        System.out.println("士兵开始射击");
        gun.shoot();
    }

}
